/* ===== Root ===== */
:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --border-strong: #9891c0;
    --thead: #f8fafc;
    --row-alt: #fbfcfe;
    --row-hover: #f3f6fd;
    --code-bg: #f3f4f6;
    --danger: #b91c1c;
}

/* ===== Base ===== */
html,
body {
    padding: 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    align-items: start;
}

.group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 12px;
    overflow-wrap: anywhere;
}

.group:first-of-type {
    margin-top: 0;
}

.group.text {
    padding: 10px 14px;
    /* margin: 0; */
    /* border-top: none; */
    /* border-radius: 0; */
}

.group.titled .title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}

/* ===== Tables ===== */
table {
    border-collapse: collapse;
    font-size: 0.95rem;
    table-layout: fixed;
}

th,
td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    vertical-align: top;
    text-align: left;
}

th {
    background: var(--thead);
    font-weight: 600;
}

.table-info-header th {
    background: #eef2ff;
    color: #27386b;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--border-strong);
}

.table-data-header th {
    background: var(--thead);
    color: #374151;
}

tbody tr:nth-child(even) td {
    background: var(--row-alt);
}

tbody tr:hover td {
    background: var(--row-hover);
}

.property-name {
    color: #374151;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.property-value {
    color: #111827;
}

.null,
.empty-collection {
    color: var(--muted);
    font-style: italic;
}

.cyclic-reference {
    color: var(--danger);
    font-style: italic;
    font-weight: 500;
}

/* Nested tables */
.property-value table {
    font-size: 0.92rem;
    border-color: var(--border);
}

.property-value table thead th {
    background: #f9fbff;
}

code,
.text code {
    background: var(--code-bg);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}

/* Spacing helpers inside text groups */
.group.text br + br {
    line-height: 1.2;
}

@media print {
    body {
        background: #fff;
        padding: 0.25in;
    }

    .group {
        box-shadow: none;
        page-break-inside: avoid;
    }

    a {
        color: inherit;
        text-decoration: none;
    }
}
